package com.ruoyi.cloudpc.service.impl;

import com.ruoyi.cloudpc.domain.CloudSupportCenter;
import com.ruoyi.cloudpc.mapper.CloudSupportCenterMapper;
import com.ruoyi.cloudpc.service.ICloudSupportCenterService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 帮助中心Service业务层处理
 *
 * @author Ten
 * @date 2025-09-28
 */
@Service
public class CloudSupportCenterServiceImpl implements ICloudSupportCenterService {
    @Autowired
    private CloudSupportCenterMapper cloudSupportCenterMapper;

    /**
     * 查询帮助中心
     *
     * @param id 帮助中心主键
     * @return 帮助中心
     */
    @Override
    public CloudSupportCenter selectCloudSupportCenterById(Integer id) {
        return cloudSupportCenterMapper.selectCloudSupportCenterById(id);
    }

    /**
     * 查询帮助中心列表
     *
     * @param cloudSupportCenter 帮助中心
     * @return 帮助中心
     */
    @Override
    public List<CloudSupportCenter> selectCloudSupportCenterList(CloudSupportCenter cloudSupportCenter) {
        return cloudSupportCenterMapper.selectCloudSupportCenterList(cloudSupportCenter);
    }

    /**
     * 新增帮助中心
     *
     * @param cloudSupportCenter 帮助中心
     * @return 结果
     */
    @Override
    public int insertCloudSupportCenter(CloudSupportCenter cloudSupportCenter) {
        cloudSupportCenter.setCreateByAndTime();
        return cloudSupportCenterMapper.insertCloudSupportCenter(cloudSupportCenter);
    }

    /**
     * 修改帮助中心
     *
     * @param cloudSupportCenter 帮助中心
     * @return 结果
     */
    @Override
    public int updateCloudSupportCenter(CloudSupportCenter cloudSupportCenter) {
        cloudSupportCenter.setUpdateByAndTime();
        return cloudSupportCenterMapper.updateCloudSupportCenter(cloudSupportCenter);
    }

    /**
     * 批量删除帮助中心
     *
     * @param ids 需要删除的帮助中心主键
     * @return 结果
     */
    @Override
    public int deleteCloudSupportCenterByIds(Integer[] ids) {
        return cloudSupportCenterMapper.deleteCloudSupportCenterByIds(ids);
    }

    /**
     * 删除帮助中心信息
     *
     * @param id 帮助中心主键
     * @return 结果
     */
    @Override
    public int deleteCloudSupportCenterById(Integer id) {
        return cloudSupportCenterMapper.deleteCloudSupportCenterById(id);
    }
}
